*     *****************************************************************   *;
*     *****************************************************************   *; 
*   Date:          January 10, 2021                               	      *;
*   Authors:       Lisa Dellmuth and Jonas Tallberg				          *;   
*   Purpose: 	   Analyses for book Legitimacy Politics: Elite  		  *;
*    Communication and Public Opinion in Global Governance (CUP, 2023)    *;
*     ****************************************************************    *;
*     ****************************************************************    *;

*WVS7, May 2020 release

*Read in WVS7 csv data to get at the different codings for missing on the knowledge questions
*Code don't knows as 0, incorrect as 0, correct as 1, and rest as missing
*Merge to completely labeled WVS7 Stata file

clear
import delimited using WVS_Cross-National_Wave_7_csv_v2_0.csv

tab q91, missing
tab q92, missing
tab q93, missing

gen knUNSC_DK0 = q91
recode knUNSC_DK0 -1 1 2=0 3=1 -5/-2=.
gen knIMF_DK0 =q92
recode knIMF_DK0 1=1 -1 2 3=0 -5/-2=.
gen knAMN_DK0=q93
recode knAMN_DK0 -1 1 3=0 2=1 -5/-2=. 
gen polknow = knUNSC_DK0+knIMF_DK0+knAMN_DK0 // additive knowledge index reported in Chapter 2

svyset d_interview, strata(b_country)

*Chapter 2
preserve
keep if b_country==76|b_country==276|b_country==608|b_country==643|b_country==840
svy:tab polknow 

*Chapter 4
svy:tab knUNSC_DK0
svy:tab knIMF_DK0
